#!/usr/bin/python3
# -*- coding:utf-8 -*-
# Copyright 2022-2023 Huawei Technologies Co., Ltd
import numpy as np


def gen_golden_data():
    x1_gm_type = np.float16
    x2_gm_type = np.float16
    
    M = 8192
    K = 68416
    N = 256
    print("python数据生成开始")
    np.random.seed(42)
    # x1_gm = np.random.randint(1, 10, [M, K]).astype(x1_gm_type)
    # x2_gm = np.random.randint(1, 10, [K, N]).astype(x2_gm_type)
    
    x1_gm = np.ones((M, K), dtype=np.float16)
    x2_gm = np.ones((K, N), dtype=np.float16)
    
    # x1_gm = np.random.rand(M, K).astype(x1_gm_type)
    # x2_gm = np.random.rand(K, N).astype(x2_gm_type)

    # for i in range(0,16):
    #     for j in range(0,16):
    #         x1_gm[i][j]=3
    #         x2_gm[i][j]=3
    
    print("python乘法开始")
    golden = np.matmul(x1_gm.astype(np.float32), x2_gm.astype(np.float32)).astype(np.float32)
    print("python乘法结束")
    
    # for i in range(0,16):
    #     print(x2_gm[-i],end=" ")
    # print()

    # print("二者相乘的结果为")
    # print(golden)
    x1_gm.tofile("./input/x1_gm.bin")
    x2_gm.tofile("./input/x2_gm.bin")
    golden.tofile("./output/golden.bin")


if __name__ == "__main__":
    gen_golden_data()
